In a database system, an expression service including a general software interpreted expression engine processes expressions within queries. Such expression engines are stack based, and use function pointers to allow arbitrary user expressions to be executed through the same framework. For example, in SQL Server's expression engine, a single data stack (typically corresponding to one row of data) and a sequence of function pointers that represent the general steps (‘instructions’) that a particular expression needs to run are maintained. Each function call takes the data stack, operates on it as necessary (reads and/or writes), and then returns. When the entire expression is done, the last data value on the stack is the result.
In many situations where the engine runs the same expression against a large set of data, the expression evaluation service sets up the data stack for a single row, for example, runs through the steps of that expression, and when finished, repeats for the next row. The overhead of setting up the stack as well as each step to be executed costs processor instructions. Any technology that provides the same results while using a reduced number of processor instructions is desirable.